/*
 * @Author: yangdingyuan yangdingyuan@bjjy.com
 * @Date: 2022-10-08 14:00:49
 * @LastEditors: yangdingyuan
 * @LastEditTime: 2022-10-08 15:39:45
 * @Description: 主路由文件（初始化得到的“test”路由可以删除）
 */
import { lazy, React, Suspense } from 'react';
import Loading from '../components/Loading';
import NotFound from '../views/errors/NotFound';
import { Routes, Route } from 'react-router-dom';
// 路由懒加载
const Hello = lazy(() => import('../views/Hello'));
const Test = lazy(() => import('../views/Test'));

const Index = () => {
    return (
        <Suspense fallback={<Loading />}>
            <Routes>
                <Route path='/' element={<Hello />} />
                <Route path='/test' element={<Test />} />
                <Route path="*" element={<NotFound />} />
            </Routes>
        </Suspense>
    );
};

export default Index;
